if(!window.Plane3D) {
  (function () {
    window.ator = (a) => {
      return a * Math.PI / 180;
    }

    window.transformPointToXY = (A, G, ox, oy) => {
      let ret = Object.assign({}, G);
      ret.x = (G.x - A.x) * A.z / (A.z - G.z) + ox;
      ret.y = (G.y - A.y) * A.z / (A.z - G.z) + oy;
      return ret;
    }

    window.transformPointRotateByY = (A, deg, antiClockwise) => {
      let tempDeg = antiClockwise ? -1 * deg : deg, ret = Object.assign({}, A);
      with(Math) {
        ret.x = A.x * cos(ator(tempDeg)) - A.z * sin(ator(tempDeg)),
        ret.y = A.y,
        ret.z = A.z * cos(ator(tempDeg)) + A.x * sin(ator(tempDeg))
      }
      return ret;
    }
  })();
} else {
  throw new Error("Plane3D 被占用")
}